from ckeditor_uploader.fields import RichTextUploadingField
from django.db import models
# Create your models here.
from db.base_model import BaseModel


class OwnInfo(BaseModel):
    logo = models.ImageField(upload_to='myself/%Y', null=True, blank=True, verbose_name='个人logo')
    nickname = models.CharField(max_length=200, verbose_name='网名')
    english_name = models.CharField(max_length=100, null=True, blank=True, verbose_name='英文名')
    address = models.CharField(max_length=100, null=True, blank=True, verbose_name='居住地')
    job = models.CharField(max_length=200, null=True, blank=True, verbose_name='工作')
    phone = models.CharField(max_length=11, null=True, blank=True, verbose_name='联系电话')
    email = models.EmailField(max_length=100, null=True, blank=True, verbose_name='邮箱')
    qq = models.CharField(max_length=50, null=True, blank=True, verbose_name='QQ号')
    wechat = models.ImageField(upload_to='myself/%Y', null=True, blank=True, verbose_name='微信二维码')
    brief = models.CharField(max_length=200, null=True, blank=True, verbose_name='简介')
    introduce = RichTextUploadingField(null=True, blank=True, verbose_name='自我介绍')

    def __str__(self):
        return self.nickname

    class Meta:
        db_table = '个人信息表'
        verbose_name = "个人信息"
        verbose_name_plural = verbose_name